package com.oildatacollection.launch;

import com.oildatacollection.server.NettyServerImpl;
import com.oildatacollection.server.Server;
import com.oildatacollection.summary.DataSummary;
import com.oildatacollection.summary.DataSummaryInfluxImpl;
import com.rpc.RpcServer;

public class OilServerLaunch {
    public static void Launch() {
        Server ser = new NettyServerImpl();
        ser.start();

        // 初始化rpc模块
        RpcServer rpcServer = new RpcServer(ser);
        rpcServer.start();

        // 汇总线程
        DataSummary summary = new DataSummaryInfluxImpl();
        summary.startSummary();

        // 等待结束
        ser.waitForEnd();
        summary.waitForEnd();
    }
}
